package net.oschina.app.factory;


import android.os.Bundle;
import android.support.v4.app.Fragment;

import net.oschina.app.fragment.Explorer.ExplorerMyActivityFragment;
import net.oschina.app.fragment.Explorer.ExplorerRecentFragment;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by wei03 on 2017/1/13.
 */

public class ExplorerActivityFactory extends BaseFactory{
    public  Fragment getFragment(int position) {
        Map<Integer, Fragment> fragments = new HashMap<>();
        Fragment fragment = fragments.get(position);
        if (fragment == null) {
            switch (position) {
                case 0:
                    fragment = new ExplorerRecentFragment();
                    Bundle event = new Bundle();
                    event.putString("uid","-1");
                    fragment.setArguments(event);
                    break;
                case 1:
                    fragment = new ExplorerMyActivityFragment();
                    Bundle myEvent = new Bundle();
                    myEvent.putString("uid","3226664");
                    fragment.setArguments(myEvent);
                    break;
                default:
                    fragment = new ExplorerRecentFragment();
            }
            fragments.put(position, fragment);
        }
        return fragment;
    }
}
